home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Message Dialogs / advanced-gallery.izs < prev    next >
Text File  |  2005-09-27  |  11KB  |  666 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Advanced Gallery 
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION> This gallery script allows you to display and rotate entire blocks of HTML on demand. Display images, text, or rich HTML in a dynamic manner. Set the script to automatically cycle through the contents like in a scroller, or via manual selecting. Furthermore, we made inputting the contents a breeze. Simply wrap desired blocks of HTML in a special <DIV> tag, and they are automatically added to the gallery. Works in IE only. 
  7. <!/DESCRIPTION> 
  8.  
  9. <!CATEGORY>Messages<!/CATEGORY>
  10.  
  11. <!SCRIPT>
  12. <!-- START OF SCRIPT -->
  13.  
  14.  
  15. <!-- HOW TO INSTALL ADVANCED GALLERY:
  16.  
  17.  
  18.  
  19.   1.  Copy code into the HEAD section of document
  20.  
  21.   2.  Put last coding into the BODY section of document  -->
  22.  
  23.  
  24.  
  25. <!-- STEP ONE: Add code into HEAD section of document  -->
  26.  
  27.  
  28.  
  29. <HEAD>
  30.  
  31.  
  32.  
  33.  
  34. <!-- Original:  Team DynamicDrive -->
  35.  
  36. <!-- Web Site:  http://www.dynamicdrive.com -->
  37.  
  38. <style type="text/css">
  39.  
  40.  
  41.  
  42. .gallerycontroller{
  43.  
  44. width: 250px
  45.  
  46. }
  47.  
  48.  
  49.  
  50. .gallerycontent{
  51.  
  52. width: 250px;
  53.  
  54. height: 200px;
  55.  
  56. border: 1px solid black;
  57.  
  58. background-color: #DFDFFF;
  59.  
  60. padding: 3px;
  61.  
  62. display: block;
  63.  
  64. }
  65.  
  66.  
  67.  
  68. </style>
  69.  
  70.  
  71.  
  72. <script type="text/javascript">
  73.  
  74.  
  75.  
  76. /***********************************************
  77.  
  78. * Advanced Gallery script- ⌐ Dynamic Drive DHTML code library (www.dynamicdrive.com)
  79.  
  80. * This notice must stay intact for legal use
  81.  
  82. * Visit http://www.dynamicdrive.com/ for full source code
  83.  
  84. ***********************************************/
  85.  
  86.  
  87.  
  88. var tickspeed=3000 //ticker speed in miliseconds (2000=2 seconds)
  89.  
  90. var displaymode="auto" //displaymode ("auto" or "manual"). No need to modify as form at the bottom will control it, unless you wish to remove form.
  91.  
  92.  
  93.  
  94. if (document.getElementById){
  95.  
  96. document.write('<style type="text/css">\n')
  97.  
  98. document.write('.gallerycontent{display:none;}\n')
  99.  
  100. document.write('</style>\n')
  101.  
  102. }
  103.  
  104.  
  105.  
  106. var selectedDiv=0
  107.  
  108. var totalDivs=0
  109.  
  110.  
  111.  
  112. function getElementbyClass(classname){
  113.  
  114. partscollect=new Array()
  115.  
  116. var inc=0
  117.  
  118. var alltags=document.all? document.all.tags("DIV") : document.getElementsByTagName("*")
  119.  
  120. for (i=0; i<alltags.length; i++){
  121.  
  122. if (alltags[i].className==classname)
  123.  
  124. partscollect[inc++]=alltags[i]
  125.  
  126. }
  127.  
  128. }
  129.  
  130.  
  131.  
  132. function contractall(){
  133.  
  134. var inc=0
  135.  
  136. while (partscollect[inc]){
  137.  
  138. partscollect[inc].style.display="none"
  139.  
  140. inc++
  141.  
  142. }
  143.  
  144. }
  145.  
  146.  
  147.  
  148. function expandone(){
  149.  
  150. var selectedDivObj=partscollect[selectedDiv]
  151.  
  152. contractall()
  153.  
  154. selectedDivObj.style.display="block"
  155.  
  156. temp.options[selectedDiv].selected=true
  157.  
  158. selectedDiv=(selectedDiv<totalDivs-1)? selectedDiv+1 : 0
  159.  
  160. if (displaymode=="auto")
  161.  
  162. autocontrolvar=setTimeout("expandone()",tickspeed)
  163.  
  164. }
  165.  
  166.  
  167.  
  168. function populatemenu(){
  169.  
  170. temp=document.gallerycontrol.menu
  171.  
  172. for (m=temp.options.length-1;m>0;m--)
  173.  
  174. temp.options[m]=null
  175.  
  176. for (i=0;i<totalDivs;i++){
  177.  
  178. var thesubject=partscollect[i].getAttribute("subject")
  179.  
  180. thesubject=(thesubject=="" || thesubject==null)? "HTML Content "+(i+1) : thesubject
  181.  
  182. temp.options[i]=new Option(thesubject,"")
  183.  
  184. }
  185.  
  186. temp.options[0].selected=true
  187.  
  188. }
  189.  
  190.  
  191.  
  192. function manualcontrol(menuobj){
  193.  
  194. if (displaymode=="manual"){
  195.  
  196. selectedDiv=menuobj
  197.  
  198. expandone()
  199.  
  200. }
  201.  
  202. }
  203.  
  204.  
  205.  
  206. function preparemode(themode){
  207.  
  208. displaymode=themode
  209.  
  210. if (typeof autocontrolvar!="undefined")
  211.  
  212. clearTimeout(autocontrolvar)
  213.  
  214. if (themode=="auto"){
  215.  
  216. document.gallerycontrol.menu.disabled=true
  217.  
  218. autocontrolvar=setTimeout("expandone()",tickspeed)
  219.  
  220. }
  221.  
  222. else
  223.  
  224. document.gallerycontrol.menu.disabled=false
  225.  
  226. }
  227.  
  228.  
  229.  
  230.  
  231.  
  232. function startgallery(){
  233.  
  234. document.getElementById("controldiv").style.display="block"
  235.  
  236. getElementbyClass("gallerycontent")
  237.  
  238. totalDivs=partscollect.length
  239.  
  240. populatemenu()
  241.  
  242. for (i=0; i<document.gallerycontrol.mode.length; i++){
  243.  
  244. if (document.gallerycontrol.mode[i].checked)
  245.  
  246. displaymode=document.gallerycontrol.mode[i].value
  247.  
  248. }
  249.  
  250. if (displaymode=="auto")
  251.  
  252. document.gallerycontrol.menu.disabled=true
  253.  
  254. expandone()
  255.  
  256. }
  257.  
  258.  
  259.  
  260. if (window.addEventListener)
  261.  
  262. window.addEventListener("load", startgallery, false)
  263.  
  264. else if (window.attachEvent)
  265.  
  266. window.attachEvent("onload", startgallery)
  267.  
  268. else if (document.getElementById)
  269.  
  270. window.onload=startgallery
  271.  
  272.  
  273.  
  274. </script>
  275.  
  276.  
  277.  
  278. </HEAD>
  279.  
  280.  
  281.  
  282. <!-- STEP TWO: Add code into BODY section of document  -->
  283.  
  284.  
  285.  
  286. <BODY>
  287.  
  288.  
  289.  
  290. <!-- Original:  Team DynamicDrive -->
  291.  
  292. <!-- Web Site:  http://www.dynamicdrive.com -->
  293.  
  294. <div class="gallerycontent" subject="What is JavaScript?">
  295.  
  296. JavaScript is a scripting language originally developed by Netscape to add interactivity and power to web documents. It is purely client side, and runs completely on the client's browser and computer.
  297.  
  298. </div>
  299.  
  300.  
  301.  
  302. <div class="gallerycontent" subject="Java & JavaScript Differences">
  303.  
  304. Java is completely different from JavaScript- it's more powerful, more complex, and unfortunately, a lot harder to master. It belongs in the same league as C, C++, and other more complex languages.
  305.  
  306. </div>
  307.  
  308.  
  309.  
  310. <div class="gallerycontent" subject="What is DHTML?">
  311.  
  312. DHTML is the embodiment of a combination of technologies- JavaScript, CSS, and HTML. Through them a new level of interactivity is possible for the end user experience.
  313.  
  314. </div>
  315.  
  316.  
  317.  
  318. <div id="controldiv" style="display:none" class="gallerycontroller">
  319.  
  320. <form name="gallerycontrol">
  321.  
  322.         <select class="gallerycontroller" size="3" name="menu" onChange="manualcontrol(this.options.selectedIndex)">
  323.  
  324.         <option>Blank form</option>
  325.  
  326.         </select><br>
  327.  
  328. Auto: <input type="radio" checked name="mode" value="auto" onClick="preparemode('auto')"> Manual: <input type="radio" name="mode" value="manual" onClick="preparemode('manual')">
  329.  
  330. </form>
  331.  
  332. </div>
  333.  
  334.  
  335. <!-- END OF SCRIPT -->
  336. <!/SCRIPT>
  337.  
  338. <!PREVIEW>
  339. <!-- START OF SCRIPT -->
  340.  
  341.  
  342.  
  343. <!-- HOW TO INSTALL ADVANCED GALLERY:
  344.  
  345.  
  346.  
  347.   1.  Copy code into the HEAD section of document
  348.  
  349.   2.  Put last coding into the BODY section of document  -->
  350.  
  351.  
  352.  
  353. <!-- STEP ONE: Add code into HEAD section of document  -->
  354.  
  355.  
  356.  
  357. <HEAD>
  358.  
  359.  
  360.  
  361.  
  362. <!-- Original:  Team DynamicDrive -->
  363.  
  364. <!-- Web Site:  http://www.dynamicdrive.com -->
  365.  
  366. <style type="text/css">
  367.  
  368.  
  369.  
  370. .gallerycontroller{
  371.  
  372. width: 250px
  373.  
  374. }
  375.  
  376.  
  377.  
  378. .gallerycontent{
  379.  
  380. width: 250px;
  381.  
  382. height: 200px;
  383.  
  384. border: 1px solid black;
  385.  
  386. background-color: #DFDFFF;
  387.  
  388. padding: 3px;
  389.  
  390. display: block;
  391.  
  392. }
  393.  
  394.  
  395.  
  396. </style>
  397.  
  398.  
  399.  
  400. <script type="text/javascript">
  401.  
  402.  
  403.  
  404. /***********************************************
  405.  
  406. * Advanced Gallery script- ⌐ Dynamic Drive DHTML code library (www.dynamicdrive.com)
  407.  
  408. * This notice must stay intact for legal use
  409.  
  410. * Visit http://www.dynamicdrive.com/ for full source code
  411.  
  412. ***********************************************/
  413.  
  414.  
  415.  
  416. var tickspeed=3000 //ticker speed in miliseconds (2000=2 seconds)
  417.  
  418. var displaymode="auto" //displaymode ("auto" or "manual"). No need to modify as form at the bottom will control it, unless you wish to remove form.
  419.  
  420.  
  421.  
  422. if (document.getElementById){
  423.  
  424. document.write('<style type="text/css">\n')
  425.  
  426. document.write('.gallerycontent{display:none;}\n')
  427.  
  428. document.write('</style>\n')
  429.  
  430. }
  431.  
  432.  
  433.  
  434. var selectedDiv=0
  435.  
  436. var totalDivs=0
  437.  
  438.  
  439.  
  440. function getElementbyClass(classname){
  441.  
  442. partscollect=new Array()
  443.  
  444. var inc=0
  445.  
  446. var alltags=document.all? document.all.tags("DIV") : document.getElementsByTagName("*")
  447.  
  448. for (i=0; i<alltags.length; i++){
  449.  
  450. if (alltags[i].className==classname)
  451.  
  452. partscollect[inc++]=alltags[i]
  453.  
  454. }
  455.  
  456. }
  457.  
  458.  
  459.  
  460. function contractall(){
  461.  
  462. var inc=0
  463.  
  464. while (partscollect[inc]){
  465.  
  466. partscollect[inc].style.display="none"
  467.  
  468. inc++
  469.  
  470. }
  471.  
  472. }
  473.  
  474.  
  475.  
  476. function expandone(){
  477.  
  478. var selectedDivObj=partscollect[selectedDiv]
  479.  
  480. contractall()
  481.  
  482. selectedDivObj.style.display="block"
  483.  
  484. temp.options[selectedDiv].selected=true
  485.  
  486. selectedDiv=(selectedDiv<totalDivs-1)? selectedDiv+1 : 0
  487.  
  488. if (displaymode=="auto")
  489.  
  490. autocontrolvar=setTimeout("expandone()",tickspeed)
  491.  
  492. }
  493.  
  494.  
  495.  
  496. function populatemenu(){
  497.  
  498. temp=document.gallerycontrol.menu
  499.  
  500. for (m=temp.options.length-1;m>0;m--)
  501.  
  502. temp.options[m]=null
  503.  
  504. for (i=0;i<totalDivs;i++){
  505.  
  506. var thesubject=partscollect[i].getAttribute("subject")
  507.  
  508. thesubject=(thesubject=="" || thesubject==null)? "HTML Content "+(i+1) : thesubject
  509.  
  510. temp.options[i]=new Option(thesubject,"")
  511.  
  512. }
  513.  
  514. temp.options[0].selected=true
  515.  
  516. }
  517.  
  518.  
  519.  
  520. function manualcontrol(menuobj){
  521.  
  522. if (displaymode=="manual"){
  523.  
  524. selectedDiv=menuobj
  525.  
  526. expandone()
  527.  
  528. }
  529.  
  530. }
  531.  
  532.  
  533.  
  534. function preparemode(themode){
  535.  
  536. displaymode=themode
  537.  
  538. if (typeof autocontrolvar!="undefined")
  539.  
  540. clearTimeout(autocontrolvar)
  541.  
  542. if (themode=="auto"){
  543.  
  544. document.gallerycontrol.menu.disabled=true
  545.  
  546. autocontrolvar=setTimeout("expandone()",tickspeed)
  547.  
  548. }
  549.  
  550. else
  551.  
  552. document.gallerycontrol.menu.disabled=false
  553.  
  554. }
  555.  
  556.  
  557.  
  558.  
  559.  
  560. function startgallery(){
  561.  
  562. document.getElementById("controldiv").style.display="block"
  563.  
  564. getElementbyClass("gallerycontent")
  565.  
  566. totalDivs=partscollect.length
  567.  
  568. populatemenu()
  569.  
  570. for (i=0; i<document.gallerycontrol.mode.length; i++){
  571.  
  572. if (document.gallerycontrol.mode[i].checked)
  573.  
  574. displaymode=document.gallerycontrol.mode[i].value
  575.  
  576. }
  577.  
  578. if (displaymode=="auto")
  579.  
  580. document.gallerycontrol.menu.disabled=true
  581.  
  582. expandone()
  583.  
  584. }
  585.  
  586.  
  587.  
  588. if (window.addEventListener)
  589.  
  590. window.addEventListener("load", startgallery, false)
  591.  
  592. else if (window.attachEvent)
  593.  
  594. window.attachEvent("onload", startgallery)
  595.  
  596. else if (document.getElementById)
  597.  
  598. window.onload=startgallery
  599.  
  600.  
  601.  
  602. </script>
  603.  
  604.  
  605.  
  606. </HEAD>
  607.  
  608.  
  609.  
  610. <!-- STEP TWO: Add code into BODY section of document  -->
  611.  
  612.  
  613.  
  614. <BODY>
  615.  
  616.  
  617.  
  618. <!-- Original:  Team DynamicDrive -->
  619.  
  620. <!-- Web Site:  http://www.dynamicdrive.com -->
  621.  
  622. <div class="gallerycontent" subject="What is JavaScript?">
  623.  
  624. JavaScript is a scripting language originally developed by Netscape to add interactivity and power to web documents. It is purely client side, and runs completely on the client's browser and computer.
  625.  
  626. </div>
  627.  
  628.  
  629.  
  630. <div class="gallerycontent" subject="Java & JavaScript Differences">
  631.  
  632. Java is completely different from JavaScript- it's more powerful, more complex, and unfortunately, a lot harder to master. It belongs in the same league as C, C++, and other more complex languages.
  633.  
  634. </div>
  635.  
  636.  
  637.  
  638. <div class="gallerycontent" subject="What is DHTML?">
  639.  
  640. DHTML is the embodiment of a combination of technologies- JavaScript, CSS, and HTML. Through them a new level of interactivity is possible for the end user experience.
  641.  
  642. </div>
  643.  
  644.  
  645.  
  646. <div id="controldiv" style="display:none" class="gallerycontroller">
  647.  
  648. <form name="gallerycontrol">
  649.  
  650.         <select class="gallerycontroller" size="3" name="menu" onChange="manualcontrol(this.options.selectedIndex)">
  651.  
  652.         <option>Blank form</option>
  653.  
  654.         </select><br>
  655.  
  656. Auto: <input type="radio" checked name="mode" value="auto" onClick="preparemode('auto')"> Manual: <input type="radio" name="mode" value="manual" onClick="preparemode('manual')">
  657.  
  658. </form>
  659.  
  660. </div>
  661.  
  662. <!-- END OF SCRIPT -->
  663. <!/PREVIEW>
  664.  
  665. <!RELATED>NONE<!/RELATED>
  666.